package com.zshy.base.mq.serialization;

/**
 * 序列化接口
 *
 * @author zhouhengzhe
 */
public interface MQEventSerialization {

    /**
     * 反序列化
     * @param src
     * @param dist
     * @return
     * @param <S>
     * @param <T>
     * @throws RuntimeException
     */
    <S, T> T deserialize(S src, Class<T> dist) throws RuntimeException;

    /**
     * 序列化
     * @param src
     * @return
     * @param <T>
     * @throws RuntimeException
     */
    <T> T serialize(Object src) throws RuntimeException;

}